<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>买家中心</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/my.css">
    <script src="../js/jquery-3.2.1.min.js"></script>
    <script src="../js/media.js"></script>
    <script src="../js/common.js"></script>
    <style>
        .public-header {
            background: rgba(95, 49, 4, 1);
        }

        .public-header-center {
            color: #fff !important;
        }
		#info_page li{
			position:relative;
		}
		.goods_nums{
			display: inline-block;
			position:absolute;
			top:-5px;
			right:-5px;
			width:20px;
			height:20px;
			border-radius:20px;
			background:red;
			text-align: center;
			line-height: 20px;
			font-size:0.1rem;
			color:#fff;
			visibility: hidden;
		}
    </style>
</head>

<body>
    <!--头部-->
    <div class="public-header flex">
        <!--<span class="public-header-left-search"></span>-->
        <!--<span class="public-header-left-back"></span>-->
        <span class="public-header-center" style="background:url(../img/切换@2x.png) no-repeat 2.16rem;background-size:.1rem .13rem;"
            >买家中心</span>
        <span class="public-header-right"></span>
    </div>

    <!--正文-->
    <div class="customer-page bc-gray" style="padding-bottom:0vw;">
        <div class="section1">
            <div style="position: absolute;top: 40px;width: 100%;">
                <img style="padding-top:0; border-radius: 100px;" src="../img/ZitaohuiLogo.png" alt="" onclick="javascript:window.location.href='../page/personal-information.html'">
                <p class="t1">
                    <span>这里是昵称</span>
                    <em></em>
                    <i>爱好者</i>
                </p>
                <p class="t2">关注:<span id="gz">0</span></p>
            </div>
            <div class="box flex">
                <div class="left" onclick="javascript:window.location.href='../wode/recharge.html'">
                    <span></span>
                    <p>账户</p>
                </div>
                <!--<div class="right" onclick="javascript:window.location.href='../page/message.html'">
                    <span></span>
                    <p>消息</p>
                </div>-->
            </div>
        </div>
        <span style="display:block;height:40px;background:#fff;"></span>
        <div class="section2">
            <a href="../page/Buyer-order.html?status=6">
                <div class="top flex">
                    <span>我的订单</span>
                    <span>全部</span>
                </div>
            </a>
            <ul class="flex bottom" id="info_page">
                <li>
                    <a href="../page/Buyer-order.html?status=1">
                        <img src="../img/付款@2x.png" alt="">
                        <p>待付款</p>
                        <span class="goods_nums goods_nums_nomoney"></span>
                    </a>
                </li>
                <li>
                    <a href="../page/Buyer-order.html?status=2">
                        <img src="../img/发货@2x.png" alt="">
                        <p>待发货</p>
                        <span class="goods_nums goods_nums_nogoods"></span>
                    </a>
                </li>
                <li>
                    <a href="../page/Buyer-order.html?status=3">
                        <img src="../img/待收货@2x.png" alt="">
                        <p>待收货</p>
                        <span class="goods_nums goods_nums_daigoods"></span>
                    </a>
                </li>
                <li>
                    <a href="../page/Buyer-order.html?status=4">
                        <img src="../img/评价@2x.png" alt="">
                        <p>待评价</p>
                        <span class="goods_nums goods_nums_daiping"></span>
                    </a>
                </li>
                <li>
                    <a href="../page/personalval.html?style=2">
                        <img src="../img/sirdz.png" alt="">
                        <p>私人订制</p>
                        <span class="goods_nums goods_nums_siren"></span>
                    </a>
                </li>
                <li>
                    <a href="../page/Buyer-order.html?status=5">
                        <img src="../img/售后@2x.png" alt="">
                        <p>售后</p>
                        <span class="goods_nums goods_nums_shouh"></span>
                    </a>
                </li>
            </ul>
        </div>
        <siv class="section3 clearfix">
            <ul>
                <li class="flex">
                    <div class="left" onclick="javascript:window.location.href='../page/New-shoots.html'">
                        <img src="../img/新品开拍@2x.png" alt="">
                        <span class="span1">最新商品</span>
                    </div>
                    <div class="right" onclick="javascript:window.location.href='../page/My-footprints.html'">
                        <img src="../img/足迹@2x.png" alt="">
                        <span class="span2">足迹</span>
                    </div>
                </li>
                <li class="flex">
                    <!--<div class="left" onclick="javascript:window.location.href='../page/Sunbird.html'">-->
                    <div class="left" onclick="javascript:window.location.href='../page/my_Excellent-shop.html'">	
                        <img src="../img/晒宝@2x.png" alt="">
                        <span class="span3">匠心献爱心</span>
                    </div>
                    <div class="left" onclick="javascript:window.location.href='../faxian/faxian.html'">
                        <img src="../img/学堂@2x.png" alt="">
                        <span class="span5">发现</span>
                    </div>
                    <!-- </li>
                <li class="flex">
                    <div class="left"  onclick="javascript:window.location.href='../page/Purple-pottery-school.html'">
                        <img src="../img/学堂@2x.png" alt="">
                        <span class="span5">紫陶学堂</span>
                    </div>-->
              <!--      <div class="right"  style="opacity: 0;" onclick="javascript:window.location.href='../page/Customer-service.html'">
                        <img src="../img/客服@2x 2.png" alt="" style="opacity: 0;">
                        <span class="span6" style="opacity: 0;"></span>
                    </div>-->
                    <!--<div class="right"  style="opacity: 0;" >
                        <img src="../img/客服@2x 2.png" alt="" style="opacity: 0;">
                        <span class="span6" style="opacity: 0;"></span>
                    </div>-->
                    <!--<div class="right">-->
                        <!--<img style="display: none;" src="../img/客服@2x 2.png" alt="">-->
                        <!--<span style="display: none" class="span6">联系客服</span>-->
                    <!--</div>-->
                </li>
                <!--<li class="flex">
                    <div class="left" onclick="javascript:window.location.href='../page/Sunbird.html'">
                        <img src="../img/学堂@2x.png" alt="">
                        <span class="span5">发现</span>
                    </div>
                    <div class="right" onclick="">
                        <img src="../img/客服@2x 2.png" alt="">
                        <span class="span5">敬请期待</span>
                    </div>
                </li>-->
            </ul>
        </siv>
    </div>

    <!--底部-->
    <div class="public-footer flex">
        <div class="button-1" onclick="javascript:window.location.href='../index.html'">
            <span></span>
            <p>首页</p>
        </div>
        <div class="button-2" onclick="javascript:window.location.href='../fenlei/fenlei.html'">
            <span></span>
            <p>分类</p>
        </div>
        <div class="button-3" onclick="javascript:window.location.href='../page/Excellent-shop.html'">
            <span></span>
            <p>店铺</p>
        </div>
        <div class="button-4 active">
            <span></span>
            <p>我的</p>
        </div>

    </div>

    <script>
        $(function () {
            $.ajax({
                url: base_url + 'ZITAOHUI/user',
                type: 'get',
                data: {
                    userId: sessionStorage.getItem("uid")
                },
                success: function (data) {
                    console.log(data);
                    let all_data = data.extend.list;
                    console.log(all_data)
                    let user_nike_name = all_data.user_nike_Name;
                    let user_type = all_data.user_grade_describe;
                    let att_num = all_data.user_attention_num;
                    let img = all_data.user_image;
                    $('.customer-page .section1 img').attr('src', img);
                    $('.customer-page .section1 .t1 span').html(user_nike_name);
                    $('.customer-page .section1 .t1 i').html(user_type);
                    $('.customer-page .section1 .t2 font').html(att_num);
                    $("#gz").text(data.extend.list2);

                }
            });
            $('.section2 ul li').on('click', function () {
//              window.location.href='../page/Buyer-order.html?num='+$(this).data('num');
                window.location.href='../page/Buyer-order.html';
            });
            $(".public-header-center").on('click',function(){
            	maijia();
            })
            function maijia (){//跳转到卖家中心的判断
//          	console.log("Sellers-center.html");
//          	if(sessionStorage.s_id){
//          		$.ajax({
//          			type:"get",
//          			url:base_url+"ZITAOHUI/store/msg",
//          			async:true,
//          			data:{
//          				store_id:sessionStorage.s_id
//          			},
//          			success:function(data){
//          				if(){
//          					window.location.href = './Sellers-center.html';
//          				}else{
//          					alert("你的店铺被冻结,请联系紫陶汇官方客服");
//          				}
//          			}
//          		});
//          	}else{
            		window.location.href = './Sellers-center.html';
            	//}
            }
            $.ajax({//买家中的产品订单状态数量
	            	url:base_url + 'ZITAOHUI/user/orderNum',
	            	type:'get',
	            	data:{
	            		userId:sessionStorage.getItem("uid"),
	            		identity:1,
	            	},
	            	success:function(data){
	            		var datas=  data.extend.num
					datas[1].user_order_num!=0?$('.goods_nums_nomoney').css('visibility','visible').text(datas[1].user_order_num):'';//待付款
					datas[2].user_order_num!=0?$('.goods_nums_nogoods').css('visibility','visible').text(datas[2].user_order_num):'';//待发货
	            		datas[3].user_order_num!=0?$('.goods_nums_daigoods').css('visibility','visible').text(datas[3].user_order_num):'';//待收货
	            		datas[4].user_order_num!=0?$('.goods_nums_daiping').css('visibility','visible').text(datas[4].user_order_num):'';//待评价
	            		datas[5].user_order_num!=0?$('.goods_nums_shouh').css('visibility','visible').text(datas[5].user_order_num):'';//售后
	            	}
            });
            $.ajax({//买家中私人订制
	            	url:base_url + 'ZITAOHUI/selectCustomization',
	            	type:'get',
	            	data:{
	            		store_id:'',
	            		user_id:sessionStorage.getItem("uid"),
	            		produce_id:'',
	            	},
	            	success:function(data){
	            		var datas=  data.extend.list
	            		datas.length!=0?$('.goods_nums_siren').css('visibility','visible').text(datas.length):'';//私人订制数量
	            	}
            })
        })
        
    </script>


</body>

</html>